import { createRouter, createWebHistory } from 'vue-router'
import Home from '@/views/Home.vue'
const routes = [
    {
        path:'/',
        name:'home',
        component:Home,
        meta:{title:'首页',show:true,icon:'House'}
        // meta 相当于打标签
    },{
        path:'/educations',
        component:()=>import('@/views/educations/index.vue'),
        meta:{title:'信息管理',show:true,icon:'Tickets'},
        children:[
            {
                path:'/educations/add',
                name:'educations-add',
                component:()=>import('@/views/educations/Add.vue'),
                meta:{title:'添加信息',show:true,icon:'Plus'}
            },
            {
                path:'/educations/edit',
                name:'educations-edit',
                component:()=>import('@/views/educations/Edit.vue'),
                meta:{title:'修改信息',show:false,icon:'Edit'}
            },
            {
                path:'/educations/list',
                name:'educations-list',
                component:()=>import('@/views/educations/List.vue'),
                meta:{title:'详情信息',show:true,icon:'Delete'}
            },
        ]
    },{
        path: '/user',
        component: () => import('@/views/user/index.vue'),
        meta: { title: '用户信息', show: false, icon: 'Menu' },
        children: [
            {
                path: '/user/register',
                name: 'user-register',
                component: ()=> import('@/views/user/Register.vue'),
                meta: { title: '用户注册', show: false, icon: 'Orange' ,useFrame: false}
            },
            {
                path: '/user/login',
                name: 'user-login',
                component: () => import('@/views/user/Login.vue'),
                meta: { title: '用户注册', show: false, icon: 'Pear' ,useFrame: false}
            },
        ]
        
    }
]


const router = createRouter({

    history: createWebHistory(),
    routes
})
// 5.导出 供main.js 挂载
export default router